package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.Role;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

public interface RoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Role record);

    List<Role> selectAll();

    int updateByPrimaryKey(Role record);
    
    Role selectByName(String name);

    void deletePermissionRelation(Long roleId);

    void insertPermissionRelation(@Param("roleId") Long roleId,@Param("pId") Long pId);

    List<Long> selectByEmpId(Long empId);

    void deleteMenuRelation(Long id);

    void insertMenuRelation(@Param("roleId") Long roleId,@Param("menuId") Long menuId);

    Collection<String> selectNameByEmpId(Long empId);
}